package server;

 
import java.io.Serializable;

import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import webWof.State;
import webWof.WebPlayer;


@PersistenceCapable
public class PlayerDB implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 8912498748078740333L;

	/**
	 * 
	 */

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;

	@Persistent
	private String name;

	@Persistent
	private String mail;

	@Persistent
	private String password;

	@Persistent
	private int score;

	public PlayerDB(String name, String mail, String password, int score) {
		this.name=name;
		this.mail = mail;
		this.password = password;
		this.score = score;
		this.key=KeyFactory.createKey(PlayerDB.class.getSimpleName(),this.name);
	}



	public Key getKey() {
		return key;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getMail() {
		return mail;
	}

	public void setMail(String mail) {
		this.mail = mail;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public int getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}

}
